﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once


#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "SamuraiPawnBase.generated.h"

class UInputMappingContext;
class UInputAction;

UCLASS()
class QUICKDRAW_API ASamuraiPawnBase : public APawn
{
	GENERATED_BODY()

public:
	// Sets default values for this pawn's properties
	ASamuraiPawnBase();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

	// 获得控制器
	virtual void PossessedBy(AController* NewController) override;

	// 攻击动作
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputAction* AttackAction;

	// 默认的映射
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputMappingContext* MappingContext;

	// 攻击按下
	UFUNCTION(BlueprintImplementableEvent)
	void AttackPressed();

	// 攻击松开
	UFUNCTION(BlueprintImplementableEvent)
	void AttackReleased();
};
